<!--包含头部文件-->
{include file="public/header" /}
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 订单管理 <span class="c-gray en">&gt;</span> 订单列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<form action="{:url('user/search')}" method="post">
		<div class="text-c"> 
			<input type="text" class="input-text" style="width:250px" placeholder="输入会员名称、电话、邮箱" id="" name="name">
			<button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜用户</button>
		</div>
	</form>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="r">共有数据：<strong>{$orders|count}</strong> 条</span> </div>
	<div class="mt-20">
	<table class="table table-border table-bordered table-hover table-bg table-sort">
		<thead>
			<tr class="text-c">
				<th width="25"><input type="checkbox" name="" value=""></th>
				<th width="150">订单编号</th>
				<th width="160">商品名</th>
				<th width="100">图片</th>
				<th width="90">买家ID</th>
				<th width="150">收货地址</th>
				<th width="150">交易时间</th>
				<th width="70">状态</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
			{volist name="orders" id="vo"}
			<tr class="text-c">
				<td><input type="checkbox" value="1" name=""></td>
				<td><u style="cursor:pointer" class="text-primary" onclick="member_show('{$vo.order_no}','{:url('order/order_detail',['id'=>$vo.id])}',{$vo.id},'420','520')" title="查看订单详情">{$vo.order_no}</u></td>
				<td>{$vo.gname}</td>
				<td><img src="{$vo.picture}" width="60" height="60" alt=""></td>
				<td>{$vo.uid|getUserById}</td>
				<td>{$vo.aid|getAddrById}</td>
				<td>{$vo.update_time}</td>
				<td class="td-status">{$vo.status|order_status}</td>
				<td class="td-manage">
					{if $vo.status == 2}
					<a attr-id = "{$vo.order_no}" href="javascript:;" title="点击发货">发货</a>
					{/if}
				</td>
			</tr>
			{/volist}
		</tbody>
	</table>
	</div>
</div>
<div class="cl pd-5 bg-1 bk-gray mt-20 tp5-o2o">{$orders->render()}</div>
<!--包含头部文件-->
{include file="public/footer" /}
<script type="text/javascript">
$(function(){
	$('.table-sort').dataTable({
		"aaSorting": [[ 1, "desc" ]],//默认第几个排序
		"bStateSave": true,//状态保存
		"aoColumnDefs": [
		  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
		  {"orderable":false,"aTargets":[0,8,9]}// 制定列不参与排序
		]
	});
	
});
/*用户-添加*/
function member_add(title,url,w,h){
	layer_show(title,url,w,h);
}
/*用户-查看*/
function member_show(title,url,id,w,h){
	layer_show(title,url,w,h);
}

$('.td-manage a').click(function(){
	var order_no = $(this).attr('attr-id');
	var url = "{:url('order/delivery')}";
	var data = {'order_no':order_no};
	$.post(url,data,function(result){
		if (result.code ==1) {
			location.href = result.data;
		} else if(result.code ==0){
			alert(result.msg);
		}
	},'json');
})

</script> 
</body>